import javax.swing.*;
import java.awt.*;

class BackgroundPanel extends JPanel
{
  Image image;
  public BackgroundPanel()
  {
	  this.setBackground(Color.WHITE);
    try
    {
      image = javax.imageio.ImageIO.read(new java.net.URL(getClass().getResource("images/"), "table.gif"));
    }
    catch (Exception e) { /*handled in paintComponent()*/ }
  }

  @Override
  protected void paintComponent(Graphics g)
  {
    super.paintComponent(g); 
    if (image != null)
      g.drawImage(image, 0,0,this.getWidth(),this.getHeight(),this);
    
  }
}